#pragma once
#include <iostream>
#include <unistd.h>
#include <fcntl.h>
#include "Log.hpp"
class Util
{
public:
    static void setNonBlock(int fd)
    {
        int ret = fcntl(fd, F_GETFL);
        if (ret < 0)
        {
            logMessage(ERROR, "setNonBlock fail");
            return;
        }
        fcntl(fd, F_SETFL, ret | O_NONBLOCK);
    }
};
